package com.dev.view.common.wdiget;

import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Typeface;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.TextView;

import com.dev.common.util.ConfigUtil;


/**
 * Created by self on 16/6/14.
 */
public class IconFontText extends TextView {

    public IconFontText(Context context) {
        super(context);
    }

    public IconFontText(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public IconFontText(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
    public IconFontText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    public void setTypeface(Typeface tf) {
        if (isInEditMode()) {
            super.setTypeface(tf);
        } else {
            super.setTypeface(ConfigUtil.build().getIconfont());
        }
    }
}
